<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <base href="${pageContext.servletContext.contextPath}/">
    <meta charset="utf-8">
    <title>个人薪资发放情况</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="static/js/layuia/css/layui.css" media="all">
    <link rel="stylesheet" href="static/css/layui/public.css" media="all">
    <style>
        .layui-form{
            font-style: normal;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
                        <div class="layui-inline">
                            <a type="submit" class="layui-btn layui-btn-primary" href="entrust/downloadtable"><i class="fa fa-file-text-o" aria-hidden="true"/> 下载模板
                            </a>
                        </div>
        </fieldset>


        <table class="layui-hide" id="LAY_table_user" lay-filter="user"/>

    </div>
</div>
<%--layui模板引擎--%>
<script type="text/html" id="setStatus">
    <input type="text" name="close" style="border: none;outline: none" disabled
           {{#  if(d.blankApproval === 1){ }}
            value="正在审核"
           {{#  } else { }}
           value="已经审核"
           {{#  } }}
           lay-skin="switch" lay-text="正常|禁用"  lay-filter="switchTest"/>
</script>
<script src="static/js/layuia/layui.js" charset="utf-8"></script>
<script >
    layui.use(['form', 'table'], function () {
        let $ = layui.$,
            form = layui.form;
        var table = layui.table;
        var laydate = layui.laydate;
        table.render({
            elem: '#LAY_table_user'
            , url: 'personal/showallmsg'
            , cols: [[
                {checkbox: true, fixed: true}
                , {field: 'issueDate', title: '核发日期', width: 100, fixed: true}
                , {field: 'issuingUnit', title: '发放单位', width: 100}
                , {field: 'listName', title: '清单名称', width: 120}
                , {field: 'issueItem', title: '应发项目', width: 120}
                , {field: 'issueMoney', title: '应发金额',width: 120}
                , {field: 'issueCount', title: '应发合计', sort: true, width: 120}
                , {field: 'deductiableItem', title: '应扣项目', sort: true, width: 120}
                , {field: 'deductiableMoney', title: '应扣金额', width: 120}
                , {field: 'salary', title: '现金', width: 80}
                , {field: 'other', title: '其他', width: 80}
                , {field: 'blankApproval', title: '银行审批状态', width: 80,templet:'#setStatus'}
                , {field: 'pendingSalary', title: '待发', width: 80}
                , {field: 'remark', title: '备注', width: 80}
                , {field: 'blankName', title: '银行名', width: 80}
                , {field: 'nonReceived', title: '未领', sort: true, width: 80}
            ]]
            , id: 'testReload'
            , page: true
            , height: 350
            , limits: [10, 20, 30]  //一页选择显示3,5或10条数据
            , limit: 10  //一页显示10条数据
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据，res为从url中get到的数据
                var result;
                if (this.page.curr) {
                    result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
                } else {
                    result = res.data.slice(0, this.limit);
                }
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.count, //解析数据长度
                    "data": result //解析数据列表
                };
            }

        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            var result = JSON.stringify(data);
            var templateName = layui.$("#tempName").value;
            console.log(templateName);
            // layer.alert(result, {
            //     title: '最终的搜索信息'
            // });


            return false;
        });

        //监听表格复选框选择
        table.on('checkbox(currentTableFilter)', function (obj) {
            console.log(obj)
        });
    });




</script>

</body>
</html>
